	// The URL
	feedURL = "http://koredecks.wordpress.com/?feed=rss";
	
	// Make the URL friendly for Javascript and API calls.
	var xmlURL = "http"+ "" +"://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q=" + encodeURIComponent(feedURL);
	
	// ID of the <div> to load into
	loadID = "#news";
	
	// This function sets up the HTML and inserts it.
	function parseXML(json) {
		
		// Store some data
		var data = {
			wpTitle		:		json.title,
			wpURL		:		json.link,
			xmlURL		:		json.feedUrl,
			entries		:		json.entries
		};
		
		// Remove loader
		$("img.loader").remove();
		
		// Load initial HTML
		$(loadID).html("<ul></ul>");
			
			// Write the title with a link.
			//$(loadID + " h1").html("<a href=\"" + data.wpURL + "\" target=\"_blank\">" + data.wpTitle + "</a>");
			
			// Loop through each entries
			for (i=0;i<data.entries.length;i++) {
				
				// Make a new list item
				$(loadID + " ul").append("<li></li>");
				
				// Start with the link to the title.
				$(loadID + " ul li:last").append("<a class=\"title\" href=\"" + data.entries[i].link + "\" target=\"_blank\">" + data.entries[i].title + "</a>");
				
				// Add the link excerpt
				$(loadID + " ul li:last").append("<p>" + data.entries[i].contentSnippet + " <a href=\"" + data.entries[i].link + "\" target=\"_blank\">" + "Read Full Article &gt;" + "</a>" + "</p>");
				
			};
	};
	
	function getXML() {
		$(loadID).append("<img src=\"XMLpreload.gif\" class=\"loader\" />");
		
		// Position it.
		$("img.loader").css({
			left: ($(document).width()/2) - 12 + "px",
			top: 200 + "px"
		});
		
		$.getJSON(xmlURL, function(data){
			console.log(data);
			if (data.responseStatus == 200) {
				parseXML(data.responseData.feed);
			} else {
				alert("Error loading");
			};
		});
	};
	
	$(document).ready(function() {
		//Go.
		getXML();
	});
	